package com.netty.zhanglong.thrift;

import com.netty.thrift.generated.DataException;
import com.netty.thrift.generated.Person;
import com.netty.thrift.generated.PersonService;
import org.apache.thrift.TException;

/**
 * Description:
 *
 * @author: StriverFeng
 * @date: 2018-10-4
 * Details:
 */
public class PersonServiceImpl implements PersonService.Iface {
    @Override
    public Person getPersonByUsername(String username) throws DataException, TException {
        System.out.println("Got Client Param: "+username);
        Person person=new Person();
        person.setUsername(username);
        person.setAge(20);
        person.setMarried(false);
        return person;
    }

    @Override
    public void savePerson(Person person) throws DataException, TException {
        System.out.println("Got Client Param");
        System.out.println(person.getUsername());
        System.out.println(person.getAge());
        System.out.println(person.isMarried());
    }
}
